home *** CD-ROM | disk | FTP | other *** search
/ Shareware Overload Trio 2 / Shareware Overload Trio Volume 2 (Chestnut CD-ROM).ISO / dir43 / pxengn13.zip / PXENGINE.TXT < prev   
Text File  |  1992-02-10  |  9KB  |  208 lines

  1. The file PXENGINE.RLZ contains the entire low-level Paradox Engine 2.0 interface along 
  2. with the error numbers and constants.  Complete documentation on the Paradox Engine is 
  3. available with the purchase of the engine from Borland International.  By executing the line  
  4. RUN "PXENGINE" in the program, you get access to the low-level interface as well as the
  5. high-level.  If you prefer not to include the high-level interface, comment out the last line in 
  6. PXENGINE.RLZ (' RUN "DB\PXEngin2").
  7.  
  8. The file PXENGIN2.RLZ contains a high-level interface to the Paradox Engine that was 
  9. developed by Within Technologies, Inc.  By executing the line  RUN "PXENGIN2" in your
  10. program, you get access to the high-level interface.
  11.  
  12. Note:Share should be installed prior to running the Paradox Engine.
  13.  
  14. High-level overview:
  15.     The purpose of the high-level interface is to eliminate, for the average Paradox 
  16.     programmer, the manipulation of table handles, record buffers, field buffers and detailed 
  17.     knowledge of Paradox field types.  The maximum number of tables that can be opened 
  18.     at once defaults to 5.  If you need to change it, refer to the manuals provided with the 
  19.     Paradox Engine (see PXSetDefaults). 
  20.  
  21.     Two concepts must be understood to use the high-level interface:
  22.         - current record number (CRN) and current record
  23.         - working record buffer (WRB)
  24.     The current record number is a position indicator for a table, and the actual record in 
  25.     the table at the CRN is called the current record.  The working record buffer is an image 
  26.     of a record in a table.  It may or may not contain data matching a particular record in a table.
  27.  
  28.     The Paradox Engine maintains a current record number (CRN) for each table opened.  
  29.     The CRN determines which record will be retrieved by GetRecord or changed by 
  30.     UpdateRecord.  The CRN can be changed by GotoRecord and Search.  If the file is 
  31.     indexed, the CRN might also change due to UpdateRecord or InsertRecord.  The high-level 
  32.     interface function GetRecNumber returns the CRN.
  33.  
  34.     The high-level interface maintains a working record buffer (WRB) for each table opened.  
  35.     GetRecord retrieves a copy of the current record into the WRB.  NewRecord blanks every 
  36.     field in the WRB.  GetField and IsBlankField examine a single field in the WRB.  PutField 
  37.     and BlankField change a single field in the WRB.
  38.  
  39.  
  40. High-level usage:
  41.     First initialize the engine with the ParadoxInit call and then open an existing table with OpenTable.  
  42.     There are several ways to access data.  To search for an existing record use the Search routine. 
  43.     To move to a specific record in the table use GotoRecord.  Access to data is performed on a 
  44.     record-by-record basis.  Call GetRecord to load the current record into the WRB, and use multiple 
  45.     GetField calls to retrieve fields of the record. 
  46.  
  47.     You may change a field in the WRB by calling PutField or BlankField.  To update the current 
  48.     record with the data in the current WRB use UpdateRecord.  Use InsertRecord to add the current 
  49.     WRB as a new record.  If you have multiple tables opened, use SelectTable to change the current 
  50.     table to another opened table or CurrentTable to return the current table ID.  
  51.  
  52.  
  53. NOTE on low-level interface:
  54.     When using the PXTblCreate routine, the PDoxDLL.EXE Dynamic Link Library (DLL) must be copied 
  55.     to the Windows directory (same directory as the PXEngWin.DLL).  PXTblCreate has the following 
  56.     interface from  Realizer:
  57.             fieldList = {"Name", "Address", "Zip", "Age", "Salary"}
  58.             typeList = {"A20", "A30", "A5", "S", "$"}
  59.             error = PXTblCreate("Sample", 5, fieldList, typeList)
  60.  
  61.  
  62. In all of the descriptions below,
  63. 1)      rsSuccess is 1 if the execution of the function was successful, 0 if the function failed
  64. 2)      gsWhichField may be either a field name or a field number (faster).  If you don't know the field
  65.     number, you can use PXFldHandle:
  66.         fldHandle = String$(2, 0)
  67.         err = PXFldHandle(tableHandle, "My Field Name", fldHandle)
  68.         IF NOT err THEN
  69.             myFieldNumber = CVI(fldHandle)          
  70.         END IF
  71.  
  72.  
  73. Summary of the high-level functions:
  74.     Engine operations:
  75.         rsSuccess = ParadoxInit
  76.         rsSuccess = ParadoxExit
  77.     Table operations:
  78.         rsSuccess = OpenTable (asFileName)
  79.         rsTableID = CurrentTable
  80.         SelectTable (rsTableID) 
  81.         rsSuccess = CloseTable
  82.     Record operations:
  83.         rsRecNum = GetRecNumber
  84.         rsSuccess = GotoRecord (rsRecNum)
  85.         rsSuccess = Search (gsWhichField, gsWhat, rsSearchHow)
  86.         rsSuccess = GetRecord
  87.         rsSuccess = NewRecord
  88.         rsSuccess = InsertRecord
  89.         rsSuccess = UpdateRecord
  90.         rsSuccess = DeleteRecord
  91.     Field operations:
  92.         rsSuccess = GetField (gsWhichField, gsBuf)
  93.         rsSuccess = PutField (gsWhichField, gsBuf)
  94.         rsSuccess = BlankField (gsWhichField)
  95.         rsIsBlank = IsBlankField (gsWhichField)
  96.  
  97.  
  98.  
  99. SYNTAX
  100.     rsSuccess = ParadoxInit
  101. DESCRIPTION
  102.     This function initializes Paradox Engine for Windows.  Once successfully called, you cannot call
  103.     it a second time without first closing the environment with ParadoxExit.
  104.  
  105. SYNTAX
  106.     rsSuccess = ParadoxExit
  107. DESCRIPTION
  108.     This function unloads the Paradox Engine DLL for this application.
  109.  
  110. SYNTAX
  111.     rsSuccess = OpenTable (asFileName)
  112. DESCRIPTION
  113.     This function opens an existing Paradox database file (table).  By default, the total number of files 
  114.     that can be opened at once is 5.  You can change this default (1-64) with PXSetDefaults.
  115.  
  116. SYNTAX
  117.     rsSuccess = CloseTable
  118. DESCRIPTION
  119.     This function closes the current database file (table).
  120.  
  121. SYNTAX
  122.     SelectTable (rsTableID) 
  123. DESCRIPTION
  124.     This command changes the current table to table rsTableID.  All subsequent Paradox calls are 
  125.     directed to this table, until the next OpenTable or SelectTable.
  126.  
  127. SYNTAX
  128.     rsTableID = CurrentTable
  129. DESCRIPTION
  130.     This function returns rsTableID of the current table.  Call after OpenTable and remember the 
  131.     rsTableID if you plan to open multiple tables.
  132.  
  133. SYNTAX
  134.     rsRecNum = GetRecNumber
  135. DESCRIPTION
  136.     This function returns the current record number.
  137.  
  138. SYNTAX
  139.     rsSuccess = GotoRecord (rsRecNum)
  140. DESCRIPTION
  141.     This function makes record rsRecNum the current record.
  142.  
  143. SYNTAX
  144.     rsSuccess = Search (gsWhichField, gsWhat, rsSearchHow)
  145. DESCRIPTION
  146.     This function finds a record that matches gsWhichField with gsWhat buffer.  You can control the 
  147.     scope of the search by setting rsSearchHow to PDX_SEARCHFIRST, PDX_SEARCHNEXT, or
  148.     PDX_SEARCHNEXT.  If rsSearchHow is set to PDX_SEARCHFIRST, the search starts at the first 
  149.     record.  In case of PDX_SEARCHNEXT, the search proceeds from the record after the current record. 
  150.     In both cases, the current record number is not changed if the specified target is not found.  
  151.  
  152.     If you set rsSearchHow to PDX_CLOSESTRECORD, the search starts at the first record.  To use 
  153.     this mode, the field must be indexed.  If there is no exact match but there is a record that has 
  154.     a value greater than the search value, the first such record becomes the current record.  If there 
  155.     isn't a record that has a value greater than or equal to the search value, the last record 
  156.     becomes the current record. 
  157.  
  158. SYNTAX
  159.     rsSuccess = GetRecord
  160. DESCRIPTION
  161.     This function retrieves the current record into the WRB.  Use GetField to examine the data.
  162.  
  163. SYNTAX
  164.     rsSuccess = NewRecord
  165. DESCRIPTION
  166.     This function clears the WRB to all blanks.
  167.  
  168. SYNTAX
  169.     rsSuccess = InsertRecord
  170. DESCRIPTION
  171.     This function inserts the WRB into the database file (table).  The position of the new record in the 
  172.     table depends on whether the table is indexed or not.  The inserted record becomes the new current 
  173.     record.  The WRB is not changed.
  174.  
  175. SYNTAX
  176.     rsSuccess = UpdateRecord
  177. DESCRIPTION
  178.     This function updates the current record with the contents of the WRB.
  179.  
  180. SYNTAX
  181.     rsSuccess = DeleteRecord
  182. DESCRIPTION
  183.     This function deletes the current record from the table (WRB is not changed).  The first record 
  184.     after the deleted one becomes the new current record.
  185.  
  186. SYNTAX
  187.     rsSuccess = GetField (gsWhichField, gsBuf)
  188. DESCRIPTION
  189.     This function gets a field value from the WRB.
  190.  
  191. SYNTAX
  192.     rsSuccess = PutField (gsWhichField, gsBuf)
  193. DESCRIPTION
  194.     This function changes a field's value in the WRB.
  195.  
  196. SYNTAX
  197.     rsSuccess = BlankField (gsWhichField)
  198. DESCRIPTION
  199.     This function blanks the field in the WRB.
  200.  
  201. SYNTAX
  202.     rsIsBlank = IsBlankField (gsWhichField)
  203. DESCRIPTION
  204.     This function checks if the field in the WRB is blank.  If it is blank, rsIsBlank = 1, otherwise, 
  205.     rsIsBlank = 0.
  206.  
  207.  
  208.